<template>
    <div class="row" style="justify-content: space-between">
        <div>
            <div class="row">
                <div v-if="isDefault === 1" class="label">
                    <div>默认</div>
                </div>
                <div class="title">{{ address }}</div>
            </div>
            <div style="height: 5px"></div>
            <div class="row">
                <text class="name">{{ name }}</text>
                <div style="width: 10px"></div>
                <text class="phone">{{ phone }}</text>
            </div>
        </div>
        <div @click="onEdit">
            <image src="@/assets/edit.png" style="width: 16px; height: 16px" />
        </div>
    </div>
</template>

<script setup lang="ts">
import { ref, defineProps } from 'vue'

interface Address {
    id: string
    address: string
    isDefault: number
    name: string
    phone: string
}
const props = defineProps<Address>()
function onEdit() {}
</script>

<style scoped lang="scss">
.row {
    display: flex;
    flex-direction: row;
    align-content: center;
}
.label {
    padding: 5px;
    border-radius: 5px;
    line-height: 12px;
    color: rgba(238, 161, 78, 1);
    background-color: rgba(251, 240, 228, 1);
    font-size: 8px;
    text-align: left;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 5px;
}
.title {
    font-weight: bold;
}

.name {
    font-size: 12px;
    color: grey;
}
.phone {
    font-size: 11px;
}
</style>
